#ifndef CONSTANTS_H_
#define CONSTANTS_H_

#define SIDE_SENS_DIFF 0.145 // difference between front-side and side sensors' samples (meters)

// values for event queue
#define ERROR_INDEX -1 // index indicating error in search

// values for wall following
#define MAX_SENSOR_RANGE 70.0 // maximal range for a sensor
#define WALL_FOLLOW_SPEED 0.2 // default speed while following wall (meter/second)
#define FIXING_DISTANCE 0.4 // vertical distance that the robot can drive to correct angle while following wall (meter)
#define TOLERANCE 0.01 //0.05 // error allowed while deciding if robot is too close or far from the wall
#define EMERGENCY_DISTANCE 0.15 // front-distance for emergency stop
#define HALF_PI 1.570796 // approximate PI/2 (avoid run-time calculations)
#define ESCAPE_CORNER_ANGLE 1.5 //1 // turn angle when reaches front wall of a corner
#define TILT_TOLERANCE 0.007 // threshold of difference between front-side and side samples when robot is aligned
#define FRONT_SIDE_DIST 0.24 // distance between front and side sensors
#define MIN_ANGLE 0.1 // minimal alignment angle (radians) allowed
#define TIME_FOR_EVENT 25000 // time to enable event handling (micro-seconds)

// values for sensor-node
#define DELIMITER ":" // delimiter between values in subscribing message

namespace sensors_names {

	// enumerates the rover's sensors
	enum ordinal {
		FRONT_LASER,
		FRONT_RIGHT_LASER,
		FRONT_LEFT_LASER,
		RIGHT_LASER,
		RIGHT_US,
		LEFT_LASER,
		LEFT_US,
		BACK_LASER,
		BACK_US,
		NUM_ITEMS
	};
}

#endif
